public class StringCompareEmp{
  public static void main(String[] arg){
      System.out.println("案例1：字符串比较");
      String str1 = "123";
      String str2 = "123";
      String str3 = "124";
      String str4 = "3";
      String str5 = "hello";

      System.out.println("字符串相等："+str1.compareTo(str2));
      System.out.println("字符串不相等："+str1.compareTo(str3));
      System.out.println("str4 出现的位置："+str1.indexOf(str4));
      System.out.println("截取部分字符："+str1.substring(1));

      System.out.println("替换字符："+str1.replace("1","2"));

      System.out.println("分割");
      
      String[] temp;
      temp = str1.split("2");
      for(String x : temp){
        System.out.println("分割元素："+x );
      }
      
      System.out.println("字符大小写转换");
      System.out.println("字符大小写转换"+str5.toUpperCase());


  }
}